﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace ManPowerEngine
{
	/// <summary>
	/// the abstract base class for attachable components in MPE
	/// </summary>
	public abstract class ComponentBase
	{
		/// <summary>
		/// The game object which this component belongs to.
		/// </summary>
		protected GameObject mGameObject;

		/// <summary>
		/// Get its game object
		/// </summary>
		public GameObject GameObject
		{
			get
			{
				return mGameObject;
			}
		}

		internal void _SetGameObject(GameObject go)
		{
			if (mGameObject != null)
				throw new ManPowerException("You can't assign the same component into the same game object");
			mGameObject = go;
		}
	}
}
